function print() {
    useDefaultPrinter();
    // Send characters/raw commands to applet using "append"
    // Hint:  Carriage Return = \r, New Line = \n, Escape Double Quotes= \"
    document.jzebra.append("A37,503,0,1,2,3,N,JZEBRA TEST PRINT\n");

    // Send characters/raw commands to printer
    document.jzebra.print();

    monitorPrinting();
}
function monitorPrinting() {
    var applet = document.jzebra;
    if (applet != null) {
        if (!applet.isDonePrinting()) {
            window.setTimeout('monitorPrinting()', 100);
        } else {
            var e = applet.getException();
            alert(e == null ? "Printed Successfully" : "Exception occured: " + e.getLocalizedMessage());
        }
    } else {
        alert("Applet not loaded!");
    }
}
function useDefaultPrinter() {
    var applet = document.jzebra;
    if (applet != null) {
        // Searches for default printer
        applet.findPrinter();
    }
}
function monitorFinding() {
    var applet = document.jzebra;
    if (applet != null) {
        if (!applet.isDoneFinding()) {
            window.setTimeout('monitorFinding()', 100);
        } else {
            var printer = applet.getPrinter();
            alert(printer == null ? "Printer not found" : "Printer \"" + printer + "\" found");
        }
    } else {
        alert("Applet not loaded!");
    }
}